<?php
return array(
	'attributeLabels'=>array(
		'web_id'=>'所属网站',
		'create_time'=>'留言时间',
		'worker_id' => '经销商'
	),
	
	'cascade' => array(
		'profile',
	),
	'rules' => array(
		array('worker_id', 'required'),
	),

	'relations' => array(
		'web'=>array(CActiveRecord::BELONGS_TO,'Website','web_id'),
		'profile' => array(ActiveRecord::HAS_ONE, 'WebNoticeProfile', 'id'),
		'worker' => array(CActiveRecord::BELONGS_TO, 'WorkerAccount', 'worker_id')
	),
	
	'tableName'=>'web_notice',
	'behaviors' => array(
		'userScope' => array(
			'class' => 'coms.behaviors.userScopes.DefaultScope',
			'relatedFields' => array(
				'worker_id',
			),
			'autoRun' => false,
		),
		'uidResolver' => array(
			'class' => 'coms.behaviors.AutoIdResolve',
			'uid' => 'worker_id',
		),
		'autoUid' => array(
			'class' => 'application.components.behaviors.AutoUidBehavior',
		),
		'webidResolver' => array(
			'class' => 'coms.behaviors.mall.AutoWebIdResolve',
		),		
	),		
	'_import' => array(
		array('*', 'models.ContentBase//*'),
	),
);